import time
from rich.console import Console
from rich.prompt import IntPrompt
from rich.progress import Progress

console = Console()

# 交互式获取文件大小
file_size = IntPrompt.ask("请输入文件大小(MB)", default=100)

# 模拟上传过程
with Progress() as progress:
    task = progress.add_task("[green]上传中...", total=file_size)
    while not progress.finished:
        progress.update(task, advance=1)
        time.sleep(0.1)
    console.print("[bold green]上传完成!")